package ro.ubbcluj.cs.damate.persistence.repository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import ro.ubbcluj.cs.damate.persistence.entities.Project;

/**
 * @author Lóránd Fazakas (lorand)
 *         Date: 5/10/12
 *         Time: 9:25 PM
 */
public interface ProjectRepository extends CrudRepository<Project, Long> {

    @Query("select p from Project p inner join p.workspaces w where p.name = ?1 and w.ipAddress = ?2 and w.path = ?3")
    Project findProject(String projectName, String ip, String workspacePath);
}
